﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
   <link href="../../Content/style.css" rel="stylesheet" type="text/css" />
</head>
<body style="background:#e1d1d6;">
    <%
        
        string flag = Html.Encode(ViewData["flag"]);
        if (flag == "0")
        {
             %>
                    <form id="form_sup1" action="../../Admin/AddSupplier" target="main_frame" method="post">
                        <p>
                            <label for="supname">Supplier Name:</label>
                            <%=Html.TextBox("supname")%>
                        </p>
                        <p>
                            <input type="submit" id="submit_btn" value="Add Supplier"/>
                        </p>
                    </form>
                         
         <%}
        else
        {
            GIFT_SHOP_MVC.Models.NhaCungCap supplier = ViewData.Model;  
              %> 
              
                    <form id="form_sup2" action="../../Admin/EditSupplier" target="main_frame" method="post">
                        <p>
                            <label for="supname">Supplier Name:</label>
                            <%=Html.TextBox("supname",supplier.TenNhaCungCap)%>
                        </p>
                        <p>
                            <label for="status">Status:</label>
                            <%=Html.DropDownList("status",(SelectList)ViewData["sttsup"])%>
                        </p>
                        <input type="hidden" name="id" value="<%=supplier.MaNhaCungCap%>" />
                        <p>
                            <input type="submit" id="submit_btn" value="Save Supplier" />
                        </p>
                    </form>
        <% 
         }%> 
</body>
</html>
